#pragma once
#include "CUIElement.h"


class HWInstance;
class HitTestPolygon;

class CLayoutTransitionElement :
	public CUIElement
{

private: 
	CLayoutTransitionElement(CUIElement * pTargetUIE, XBOOL isAbsolutelyPositioned);
private: 
	virtual ~CLayoutTransitionElement();
public: 
	static HRESULT Create(CUIElement * pTargetUIE, XBOOL isAbsolutelyPositioned, CLayoutTransitionElement * * ppLTE);
	HRESULT Initialize();
	virtual XUINT32 GetTypeIndex() const;
	CUIElement * GetTargetElement() const;
	XBOOL IsAbsolutelyPositioned() const;
	virtual XFLOAT GetActualOffsetX();
	virtual XFLOAT GetActualOffsetY();
	virtual XFLOAT GetActualWidth();
	virtual XFLOAT GetActualHeight();
	virtual void GetShouldFlipRTL(XBOOL * pShouldFlipRTL, XBOOL * pShouldFlipRTLInPlace);
	struct XPOINTF GetPositionRelativeToParent();
	void SetDestinationOffset(struct XPOINTF offset);
	virtual void ClearPCRenderData();
	XBOOL IsPrimaryTransitionForTarget();
	void SetIsPrimaryTransitionForTarget(XBOOL isPrimaryTransition);
	HRESULT GetSecondaryTransitionRenderDataNoRef(xvector<HWInstance *> * * ppRenderData);
	void ClearSecondaryRenderData();
protected: 
	virtual HRESULT GenerateChildOuterBounds(struct XRECTF_RB * pBounds);
	virtual HRESULT BoundsTestChildren(const HitTestPolygon & target, struct IBoundsTestCallback * pCallback, enum BoundsWalkHitResult::Value * pResult);
	virtual HRESULT BoundsTestChildren(const struct XPOINTF & target, struct IBoundsTestCallback * pCallback, enum BoundsWalkHitResult::Value * pResult);
	virtual XUINT32 IgnoresInheritedClips();
private: 
	virtual HRESULT LeavePCSceneSubgraph();
	CUIElement * m_pTarget;
	struct XPOINTF m_destinationOffset;
	struct  
	{
		XBOOL m_isAbsolutelyPositioned:1;
		XBOOL m_isPrimaryTransition:1;
	};

	xvector<HWInstance *> * m_pSecondaryPathRenderData;
};